#!/usr/bin/python3
# -*- coding: utf-8 -*-
import logging

import pytest

logger = logging.getLogger()

@pytest.fixture(scope="function")
def hah():
    print("fixture1")

@pytest.fixture(scope="function")
def hah1():
    print("fixture2")


def pytest_sessionfinish(session, exitstatus):
    print("session finish ")
    report = []
    for item in session.items:
        if item.reportinfo()[1]:
            status = 'passed'
        else:
            status = 'failed'
        report.append(f"{item.name}: {status}")
    with open('test_report.txt', 'w') as f:
        f.write('\n'.join(report))


def test_1(hah,hah1):
    print("\nasdf")
    logger.info("hja")

def test_2(hah,hah1):
    print("\nasdf")
    logger.info("hja")